import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: () => import('@renderer/common/views/Layout.vue'),
      children: [
        {
          path: '/',
          name: 'home',
          component: () => import('@renderer/common/views/Home.vue'),
          meta: {
            name: '首页',
            icon: 'House'
          }
        },
        {
          path: '/project',
          name: 'project',
          meta: {
            name: '项目',
            icon: 'Folder'
          },
          children: [
            {
              path: '',
              name: 'projectList',
              component: () => import('@renderer/project/views/Project.vue'),
            },
            {
              path: ':id',
              name: 'projectDetail',
              component: () => import('@renderer/project/views/ProjectDetail.vue'),
              meta: {
                hidden: true
              }
            }
          ]
        },
        {
          path: '/server',
          name: 'server',
          component: () => import('@renderer//server/views/Server.vue'),
          meta: {
            name: '服务器',
            icon: 'Monitor'
          }
        },
        {
          path: '/test',
          name: 'test',
          component: () => import('@renderer//test/views/Test.vue'),
          meta: {
            name: '测试',
            icon: 'Monitor'
          }
        }
      ]
    },
    {
      path: '/sysMenu',
      name: 'sysMenu',
      children:[
        {
          path: '/sysMenu/settings',
          name: 'sysSettings',
          component: () => import('@renderer/common/views/sysMenu/Settings.vue'),
          meta: {
            name: '设置',
          },
        },
        {
          path: '/sysMenu/proxy',
          name: 'sysProxy',
          component: () => import('@renderer/common/views/sysMenu/Proxy.vue'),
          meta: {
            name: '代理设置',
          },
        },
        {
          path: '/sysMenu/about',
          name: 'sysAbout',
          component: () => import('@renderer/common/views/sysMenu/About.vue'),
          meta: {
            name: '关于',
          }
        },
        {
          path: '/sysMenu/shortcutKey',
          name: 'sysMenuShortcutKey',
          component: () => import('@renderer/common/views/sysMenu/ShortcutKey.vue'),
          meta: {
            name: '快捷键',
          }
        }
      ]
    }
  ]
})

export default router
